package com.sgb.kjwl.model.entity.user;

import android.text.TextUtils;

import com.sgb.kjwl.utils.NumberFormatUtils;

import java.io.Serializable;
import java.util.List;

public class OrderListEntity implements Serializable {

//    amount	总价	number
//    commodityCosts	商品费用	array	OrderCommodityCostVO
//    companyName	所属公司名称	string
//    count	数量	number
//    deliveryCost	配送费	number
//    deliveryState	发货状态	integer
//    handlingCost	装卸费	number
//    id	订单id	string
//    imgList	商品图片	array	string
//    installationCost	安装费	number
//    jumpComId	跳转企业ID	integer
//    jumpComNo	跳转企业No	string
//    latestDeliverState	物流状态 未发货：2 待收货:0 已收货:1	integer
//    latestPayState	支付状态 在线付款审批中:40 在线付款已拒绝:42 在线付款待付款:0 在线付款冻结中:1 在线付款已成功:2 线下付款待付款:0 线下付款确认中:4 线下付款付款成功:2	integer
//    money	单价	number
//    name	商品名称	string
//    owned	所属公司编号	string
//    ownedName	销售订单列表的采购商名称	string
//    payApplication	是否有审批	integer
//    payState	付款状态	integer
//    paymentMethod	0 在线付款 1 线下付款	integer
//    personName	跟单人	string
//    processState	审批状态（0：待审批，1：审批通过 ，2审批不通过 3 无审批)	integer
//    processType	审批类型： 1 下单审批 2接单审批 3支付审批	integer
//    skuDetails	sku明细	array	CommoditySkuDetailVO
//    name	名称	string
//    val	值	string
//    state	订单状态-1 待下单 0 待接单 10 待签收 101 待支付 102 待发货 103 已发货 7 已完成 8 已取消	integer
//    supplier	供应商	string
//    supplierName	企业名称	string
//    unit	单位	string
    private Integer latestDeliverState;
    private Integer latestPayState;
    private Integer payApplication;
    private Integer paymentMethod;
    private Integer processState;
    private Integer processType;
    /** 下单审批状态（0：待审批，1：审批通过 ，2审批不通过 3 无审批 4 当前不在审批状态 但是配置有审批 */
    public Integer placeProcessState;
    private String jumpComId;
    private String supplierName;
    private Number amount;
    private String companyName;
    private Number count;
    private Number payState;
    private String personName;
    private String unit;
    private Number money;
    private List<SkuDetailsDTO> skuDetails;
    private String owned;
    private Number deliveryState;
    private String supplier;
    private Number handlingCost;
    private Number installationCost;
    private String name;
    private String jumpComNo;
    private Number id;
    private int state;
    private int selfSupportTag;
    private Number deliveryCost;
    private List<String> imgList;
    private String ownedName;
    /** 是否有合约信息 */
    public boolean contract;
    /** 最新付款进度： -1 没有申请 一笔付款 0 有付款 待都没付款成功 */
    public int payCount;
    /** 销售订单该字段是发货 为0 表示一笔货没发， 采购是收货的 为-1 表示一笔货没发， 0 表示一笔货没收 */
    public int deliverCount;
    /** 合同状态（0：没有合同、1：拟定中、21：待采购商签署、22：待销售商签署、3：已完成、4：已过期、5：已作废） */
    public int contractStatus;
    /** 采购方式 1 直接采购 2合约采购 */
    public int purchasingMethod;
    public List<CommodityCost> commodityCosts;
    public class CommodityCost{
        public String categoryId;
        public String clientId;
        public String created;
        public String creator;
        public String id;
        public String money;
        public String orderId;
        public String type;
        public String updated;
        public String updater;
    }

    public String getInstallationCost() {
        return NumberFormatUtils.formatAmtNoUseGroup(installationCost);
    }

    public void setInstallationCost(Number installationCost) {
        this.installationCost = installationCost;
    }

    public Integer getLatestDeliverState() {
        if (latestDeliverState == null){
            return -1;
        }
        return latestDeliverState;
    }

    public void setLatestDeliverState(Integer latestDeliverState) {
        this.latestDeliverState = latestDeliverState;
    }

    public Integer getLatestPayState() {
        return latestPayState;
    }

    public void setLatestPayState(Integer latestPayState) {
        this.latestPayState = latestPayState;
    }

    public Integer getPayApplication() {
        return payApplication;
    }

    public void setPayApplication(Integer payApplication) {
        this.payApplication = payApplication;
    }

    public Integer getPaymentMethod() {
        return paymentMethod;
    }

    public void setPaymentMethod(Integer paymentMethod) {
        this.paymentMethod = paymentMethod;
    }

    public String getOwnedName() {
        if (TextUtils.isEmpty(ownedName)){
            return companyName;
        }
        return ownedName;
    }

    public void setOwnedName(String ownedName) {
        this.ownedName = ownedName;
    }

    public Integer getProcessState() {
        return processState;
    }

    public void setProcessState(Integer processState) {
        this.processState = processState;
    }

    public Integer getProcessType() {
        return processType;
    }

    public void setProcessType(Integer processType) {
        this.processType = processType;
    }

    public String getJumpComId() {
        return jumpComId;
    }

    public void setJumpComId(String jumpComId) {
        this.jumpComId = jumpComId;
    }

    public String getSupplier() {
        return supplier;
    }

    public void setSupplier(String supplier) {
        this.supplier = supplier;
    }

    public String getOwned() {
        return owned;
    }

    public void setOwned(String owned) {
        this.owned = owned;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public String getAmount() {
        return NumberFormatUtils.formatAmtNoUseGroup(amount);
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getCount() {
        return NumberFormatUtils.baseFormatAmt(count, 3, false);
    }

    public void setCount(int count) {
        this.count = count;
    }

    public Number getPayState() {
        return payState;
    }

    public void setPayState(int payState) {
        this.payState = payState;
    }

    public String getPersonName() {
        return personName;
    }

    public void setPersonName(String personName) {
        this.personName = personName;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public String getMoney() {
        return NumberFormatUtils.formatAmtNoUseGroup(money);
    }

    public void setMoney(double money) {
        this.money = money;
    }

    public List<SkuDetailsDTO> getSkuDetails() {
        return skuDetails;
    }

    public void setSkuDetails(List<SkuDetailsDTO> skuDetails) {
        this.skuDetails = skuDetails;
    }

    public Number getDeliveryState() {
        return deliveryState;
    }

    public void setDeliveryState(int deliveryState) {
        this.deliveryState = deliveryState;
    }

    public String getHandlingCost() {
        return NumberFormatUtils.formatAmtNoUseGroup(handlingCost);
    }

    public void setHandlingCost(int handlingCost) {
        this.handlingCost = handlingCost;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getJumpComNo() {
        return jumpComNo;
    }

    public void setJumpComNo(String jumpComNo) {
        this.jumpComNo = jumpComNo;
    }

    public Number getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getDeliveryCost() {
        return NumberFormatUtils.formatAmtNoUseGroup(deliveryCost);
    }

    public void setDeliveryCost(int deliveryCost) {
        this.deliveryCost = deliveryCost;
    }

    public List<String> getImgList() {
        return imgList;
    }

    public void setImgList(List<String> imgList) {
        this.imgList = imgList;
    }

    public int getSelfSupportTag() {
        return selfSupportTag;
    }

    public void setSelfSupportTag(int selfSupportTag) {
        this.selfSupportTag = selfSupportTag;
    }

    public static class SkuDetailsDTO implements Serializable{
        private String val;
        private String name;

        public String getVal() {
            return val;
        }

        public void setVal(String val) {
            this.val = val;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }
}
